import time

from Page.Page import Page
from selenium.webdriver.common.by import By
class Page1(Page):
    search = (By.ID,'wd')
    shop = (By.XPATH,'/html/body/div[6]/div/div[2]/div[5]/ul/li[1]/div[2]/div[1]/a/img')
    addgwc = (By.NAME,'detail_jiarugouwuche')
    look = (By.NAME,'detail_chakangouwuche')
    user = (By.XPATH,'/html/body/div[2]/div/div[2]/ul/li[1]/div[1]/a')
    daxue = (By.CLASS_NAME,'level.level2')
    price = (By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[3]/div[2]/div[2]/span[1]/strong')
    def user_loc(self):
        return self.dy(self.user)
    def daxue_loc(self):
        return self.dy(self.daxue)
    def price_loc(self):
        return self.dy(self.price)
    def serch_loc(self):
        self.send_keys(self.search,'我的大学')
    def keys1(self):
        self.keys(self.search)
    def shop_loc(self):
        self.click(self.shop)
    def addgwc_loc(self):
        self.click(self.addgwc)
    def look_loc(self):
        self.click(self.look)


    def addshop_lj(self):
        self.login_lj()
        time.sleep(2)
        a= self.user_loc()
        print(a)
        assert a in '我的酒仙'
        self.serch_loc()
        self.keys1()
        b = self.daxue_loc()
        print(b)
        assert b in '我的大学'
        self.stea(200)
        self.shop_loc()
        self.window()
        self.addgwc_loc()

